package com.sm.exception;

import lombok.AllArgsConstructor;

/**
 * @author Cola
 * @description 异常枚举类
 * @date 2022/1/31
 */
@AllArgsConstructor
public enum CodeEnum implements ExceptionAssert {
    success(200, "成功"),
    fail(400, "失败"),
    no_login(201, "账号未登录"),
    wrong_parameter(202, "参数错误"),
    no_role(203, "缺少权限"),
    wrong_password(204, "密码错误"),
    fail_update_password(205, "修改密码错误"),
    username_not_exist(206, "用户名不存在"),
    course_already_full(207, "课程人数已满"),
    fail_select_course(208, "选课失败"),
    wrong_request_method(209, "请求方法有误"),
    course_already_select(210, "你已成功选课"),
    course_not_exist(211, "该课程不存在"),
    fail_cancel_select_course(212,"退选失败"),
    fail_get_user_info(213,"获取用户信息失败"),
    student_register_fail(214,"注册失败"),
    account_already_exist(215,"该用户名已存在，注册失败"),
    fail_delete_student_account(216,"删除学生账号失败"),



    error(500, "系统异常");

    public int code;
    public String message;

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }


}
